{template 'common/header'}
<ul class="nav nav-tabs">
	<li class="active"><a href="{php echo $this->createWebUrl('joke', array('op'=>'display'));}">笑话列表</a></li>
	<li><a href="{php echo $this->createWebUrl('joke', array('op'=>'edit'));}">添加笑话</a></li>
</ul>

<div class="main">
	<div class="panel panel-default">
		<div class="panel-heading">笑话列表</div>
		<div class="panel-body">
			<div class="table-responsive panel-body">
				<table class="table table-hover" style="min-width: 300px;">
					<thead class="navbar-inner">
						<tr>
							<th class="col-sm-1">ID</th>
							<th class="col-sm-2">标题</th>
							<th class="col-sm-1">时间</th>
							<th class="col-sm-1 text-right">操作</th>
						</tr>			
					</thead>
					<tbody>
						{loop $jokedb $jokeid $jokes}
							<tr>
								<td>{$jokes['id']}</td>
								<td>{$jokes['title']}</td>
								<td> {php echo date('Y-m-d', $jokes['createtime']);} </td>
								<td class="text-right">
									<a href="{php echo $this->createWebUrl('joke', array('op'=>'edit', 'id'=>$jokeid));}" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="" data-original-title="编辑">
										<i class="fa fa-pencil"></i>
									</a>
									<a href="{php echo $this->createWebUrl('joke', array('op'=>'delete', 'id'=>$jokeid));}" class="btn btn-default btn-danger" data-toggle="tooltip" data-placement="top" title="" data-original-title="删除" onclick="if(!confirm('删除后将不可恢复,确定删除吗?')) return false;" >
										<i class="fa fa-times"></i> 
									</a>
								</td>
							</tr>	
						{/loop}	
						{if empty($jokedb)}
						<tr>
							<td colspan="3">
								尚未添加笑话
							</td>
						</tr>
						{/if}
					</tbody>							
				</table>
				{$pager}
			</div>
		</div>
	</div>
</div>
{template 'common/footer'}